﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.News
{
    public partial class del_category : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = int.Parse(Request.Form["id"].ToString());
            new TblNewsCategoryController().Update(id, null,null, true);
            var get_news = new TblNewsController().FetchAll().Where(x => x.NewsCategory == id);

            foreach (TblNews news in get_news)
            {
                new TblNewsController().Update(news.NewsId, null, null, null, null, null, null, null, null, false, null, false, null, null, null, null);
            }
        }
    }
}